(desktop only)
A basic hello world example for ThreeJS. This is a library that I think is the future and I've been wanting to get more into. This example is basically copied and pasted from the docs, but it's nice to see that the backend of the theo.wtf website works with it. I'll probably play around with it a little more, but I'm not expecting to get too far. JS inside HTML feels very different than JSX inside JS like I'm used to in react. I know that there's a reacty way to use ThreeJS, but that is a task for a different time / project
Ok so I felt bad just copying and pasting the ThreeJS hello world, so now it is responsive, the color animates, we are using a phong material and there is a light in the scene. Still a good bit of copy pasting here (especially with the responsive stuff which my braing just could not handle), but at least I figured out the color changing myself.
The main part of that was figuring out the correct way to update the material, but luckilly, once I found the relevant documentation it was just me being dumb that slowed things down. Some basic trig later and we got a nice little rainbow.
These WebGL renderers sure do make me apprecieate cycles though. I think for the thumbnail I'll show this cube in a real render (also just remembered I still need to actually make a thumbnail for this #ugh oh well, it's not too late and it wont be too hard. My poor brain is just a little out of breath)
double ok, I'm actually starting to have some fun now. I made the camera zoom in and out based on the window width and did some very basic responsive css on the blog post to complement that. No copy pasting here, and I'm starting to see the light where my existing 3d knowledge will meet with what I will learn about ThreeJS / javascript / the HTML DOM in the future.